import request from '@/utils/request'

// 查询订单列表
export function listOrder(query) {
  return request({
    url: '/order/order/list',
    method: 'get',
    params: query
  })
}

// 查询订单详细
export function getOrder(orderId) {
  return request({
    url: '/order/order/' + orderId,
    method: 'get'
  })
}

export function getCartOrderList(orderId,userId) {
  return request({
    url: '/order/orderSku/getCartOrderList',
    method: 'post',
    params: {
      orderId: orderId,
      userId: userId
    }
  })
}



//获取用户地址
export function getUserTakeList(data) {
  return request({
    url: '/order/orderSku/getUserTake?userId='+data,
    method: 'post',
  })
}

// 修改订单
export function updateOrder(data) {
  return request({
    url: '/order/order',
    method: 'put',
    data: data
  })
}

// 删除订单
export function delOrder(orderId) {
  return request({
    url: '/order/order/' + orderId,
    method: 'delete'
  })
}

// 删除订单
export function pay(orderCode) {
  return request({
    url: '/alipay/pay/' + orderCode,
    method: 'get'
  })
}

export function getOrderResponse(uuid){
  return request({
    url:'/order/orderSku/getOrderResponse?uuid='+uuid,
    method: 'get'
  })
}
